package com.youi.shop.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author xxf
 * @since 2020-11-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_order")
@ApiModel(value="Order对象", description="订单表")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单主键")
    @TableId(value = "order_id", type = IdType.AUTO)
    private Long orderId;

    @ApiModelProperty(value = "会员主键")
    @TableField("member_id")
    private Long memberId;

    @ApiModelProperty(value = "地址表主键")
    @TableField("address_id")
    private Long addressId;

    @ApiModelProperty(value = "订单编号")
    @TableField("order_sn")
    private String orderSn;

    @ApiModelProperty(value = "提交时间")
    @TableField("create_time")
    private Date createTime;

    @ApiModelProperty(value = "订单总金额")
    @TableField("total_amount")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "支付方式：0->未支付；1->支付宝；2->微信")
    @TableField("pay_type")
    private Integer payType;

    @ApiModelProperty(value = "订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "订单备注")
    @TableField("note")
    private String note;

    @ApiModelProperty(value = "订单评价")
    @TableField("order_comment")
    private String orderComment;

    @ApiModelProperty(value = "评价时间")
    @TableField("comment_time")
    private Date commentTime;

    @ApiModelProperty(value = "支付时间")
    @TableField("payment_time")
    private Date paymentTime;

    @ApiModelProperty(value = "发货时间")
    @TableField("delivery_time")
    private Date deliveryTime;

    @ApiModelProperty(value = "确认收货时间")
    @TableField("receive_time")
    private Date receiveTime;

    @ApiModelProperty(value = "确认收货状态：0->未确认；1->已确认")
    @TableField("confirm_status")
    private Integer confirmStatus;

    @TableLogic
    @ApiModelProperty(value = "删除状态：0->未删除；1->已删除")
    @TableField("delete_status")
    private Integer deleteStatus;

    @TableField(exist = false)
    private CompanyAddress addresses;

    @TableField(exist = false)
    private List<OrderItem> orderItems;



}
